package com.one.consumer.main.model;

import com.one.common.model.bean.BannerBean;
import com.one.common.model.http.NetConstant;
import com.one.common.model.http.base.BaseModel;
import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.view.base.BaseActivity;

import java.util.ArrayList;
import java.util.Map;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/8/5 下午8:24
 * description ：
 **/
public class MainModel extends BaseModel<MainApi> {
    public MainModel(BaseActivity mActivity) {
        super(MainApi.class, mActivity, NetConstant.APP_HOST_WORKER);
    }

    /**
     * 获取首页banner
     */
    public void getBanner(ObserverOnResultListener<ArrayList<BannerBean>> listener){
        handleOnResultObserver(mApiService.getBanner("1"), listener);//1:用户 2:师傅
    }

    /**
     * 获取首页信息
     */
    public void getMainInfo(ObserverOnResultListener<String> listener){
        handleOnResultObserver(mApiService.getMainInfo(), listener);
    }

}
